<%-- 
    Document   : view_quizzes
    Created on : Jan 4, 2013, 3:32:55 PM
    Author     : Vuong Pham<Vuong.Pham@hva.nl>
--%>
<%@include file="template/configuration.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${website} || View Quizzes</title>
        ${stylesheet}
        ${jquery}
        ${jsdropdown}
    </head>
    <body>
        <div class="container">
            <%@include file="template/header.jsp" %>
            <div class="content">
                <h1>Quizzes</h1>

                <div class="clear margin-bottom-10"></div>
                <div class="full-block">
                    <table class="overview">
                        <tr>
                            <th>Quiz name</th>
                            <th>Description</th>
                            <th></th>
                        </tr>

                        <c:forEach items="${quizList}" var="quiz">
                            <c:set var="i" value="${i + 1}"/>
                            <tr class="pointer <c:choose><c:when test="${i % 2 == 0}">even</c:when><c:otherwise>odd</c:otherwise></c:choose>" >
                                <td>${quiz.name}</td>
                                <td>
                                    <c:choose>
                                        <c:when test="${fn:length(quiz.description) > 40}">
                                            <c:out value="${fn:substring(quiz.description, 0, 40)}"/>...
                                        </c:when>
                                        <c:otherwise>
                                            ${quiz.description}
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                                <td><a href="TakeQuiz?quizid=${quiz.id}">Take this Quiz<a></td>
                            </tr>
                        </c:forEach>
                    </table>
                    <c:choose>
                        <c:when test="${quizList == null}">
                            There are no quizzes at this moment.
                        </c:when>
                    </c:choose>
                </div>
            </div>
            <%@include file="template/footer.jsp" %>
        </div>
    </body>
</html>